using FSM.Model; 
using System; 
using System.Collections.Generic; 
using System.Text; 
 
namespace FSM.IBll 
{ 
    public interface ISysMenuBll 
    { 
        #region 查询 
        /// <summary> 
        /// 根据键值查询单个信息 
        /// </summary> 
        /// <param name="menu_no">键值</param> 
        /// <returns></returns> 
        sys_menu Get(string menu_no);

        /// <summary> 
        /// 查询批量信息 
        /// </summary>
        /// <param name="menu_name">菜单名称</param>
        /// <param name="menu_pno">上级菜单代码</param>
        /// <param name="page">页码</param> 
        /// <param name="page_size">每页显示的条数</param> 
        /// <returns></returns> 
        Tuple<List<sys_menu>, int> List(string menu_name, string menu_pno, int page, int page_size);

        /// <summary>
        /// 获得菜单树信息
        /// </summary>
        /// <param name="menu_pno">上级菜单</param>
        /// <returns></returns>
        List<sys_menu> Tree(string menu_pno);

        /// <summary>
        /// 获得菜单树信息包含动作信息)
        /// </summary>
        /// <param name="menu_pno">上级菜单</param>
        /// <returns></returns>
        List<sys_menu> TreeContainActions(string menu_pno);

        /// <summary>
        /// 获得最新的菜单ID
        /// </summary>
        /// <param name="p_no">上级菜单编号</param>
        /// <returns></returns>
        string GetNewID(string p_no);

        #endregion

        #region 提交 
        /// <summary> 
        /// 添加当前列表数据 
        /// </summary> 
        /// <param name="model">实体</param> 
        /// <returns></returns> 
        bool Insert(sys_menu model); 
 
        /// <summary> 
        /// 更新当前列表数据 
        /// </summary> 
        /// <param name="model">实体</param> 
        /// <returns></returns> 
        bool Update(sys_menu model); 
 
        /// <summary> 
        ///  删除当前列表数据 
        /// </summary> 
        /// <param name="menu_no">键值</param> 
        /// <returns></returns> 
        bool Delete(string menu_no);
        #endregion

        #region 关联方法

        /// <summary>
        /// 通过用户编号获得菜单信息
        /// </summary>
        /// <param name="user_no">用户编号</param>
        /// <returns></returns>
        List<sys_menu> ListMenusByUser(string user_no);

        /// <summary>
        /// 通过用户编号获得菜单树
        /// </summary>
        /// <param name="user_no">用户编号</param>
        /// <returns></returns>
        List<sys_menu> TreeByUser(string user_no);

        #endregion
    }
} 
